// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
//    ext {
//        core_version = "1.5.0"
//        kotlin_version = "1.5.0"
//        booster_version = "3.3.1"
//        roomVersion = "2.3.0"
//        mmkvVersion = "1.2.9"
//        koinVersion = "2.0.1"
//        dokitVersion = "3.4.3"
//        appcompatVersion = "1.3.0"
//        annotationVersion = "1.2.0"
//        recycleViewVersion = "1.2.0"
//        lifeCycleVersion = "2.3.1"
//    }
    repositories {

//        google()
//        mavenCentral()
        maven { setUrl("https://maven.aliyun.com/repository/google") }
        maven { setUrl("https://maven.aliyun.com/repository/public") }
        maven { setUrl("https://maven.aliyun.com/repository/central") }
        maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") }
        maven { setUrl("https://jitpack.io") }
        maven { setUrl("https://oss.sonatype.org/content/repositories/public") }
        // Huawei Pay
        maven { setUrl("https://developer.huawei.com/repo/")}
        //  Snapchat
        maven {setUrl("https://storage.googleapis.com/snap-kit-build/maven")}
        maven {setUrl("https://raw.githubusercontent.com/Snap-Kit/release-maven/repo")}

        //友盟+统计和Push相关SDK
        maven { setUrl("https://repo1.maven.org/maven2/") }
//        maven { setUrl("https://dl.bintray.com/umsdk/release") }

        // 自建仓库
//        maven {
//            isAllowInsecureProtocol = true
//            url = uri("http://192.168.1.195:8040/artifactory/android_group")
//        }

    }
    dependencies {
        //Gradle版本
        classpath(ClassPaths.gradle)
        //Google服务
        classpath(ClassPaths.googleService)
        classpath(ClassPaths.navigationPlugin)
        classpath(ClassPaths.kotlinGradlePlugin)
        classpath(ClassPaths.androidApt)
        // Huawei
        classpath(ClassPaths.huaweiAgcp)
        // Dokit
        classpath(ClassPaths.dokitxPlugin)

        classpath(ClassPaths.boosterPlugin)
        classpath(ClassPaths.boosterAnalyser)
        classpath(ClassPaths.boosterDaemon)
        classpath(ClassPaths.boosterThread)
    }
}

allprojects {

    repositories {
//        google()
//        mavenCentral()
        maven { setUrl("https://maven.aliyun.com/repository/google") }
        maven { setUrl("https://maven.aliyun.com/repository/public") }
        maven { setUrl("https://maven.aliyun.com/repository/central") }
        maven { setUrl("https://maven.aliyun.com/repository/gradle-plugin") }
        maven { setUrl("https://jitpack.io") }
        maven { setUrl("https://oss.sonatype.org/content/repositories/public") }
        // Huawei Pay
        maven { setUrl("https://developer.huawei.com/repo/")}
        //  Snapchat
        maven {setUrl("https://storage.googleapis.com/snap-kit-build/maven")}
        maven {setUrl("https://raw.githubusercontent.com/Snap-Kit/release-maven/repo")}

        //友盟+统计和Push相关SDK
        maven { setUrl("https://repo1.maven.org/maven2/") }
//        maven { setUrl("https://dl.bintray.com/umsdk/release") }

        // 自建仓库
//        maven {
//            isAllowInsecureProtocol = true
//            url = uri("http://192.168.1.195:8040/artifactory/android_group")
//        }
//        flatDir {
//            dirs = setOf(file("libs"), project(":sdk_push").file("libs"))
//        }
    }
}

extra {

//    grafana = [
//            debugHost: "local.monitor.miaoshitech.com",
////            debugHost: "run.monitor.miaoshitech.com",
//            debugPort: "8094",
//            releaseHost: "monitor.miaoshitech.com",
//            releasePort: "8094",
//    ]
//
//    abiFilters = ["armeabi", "armeabi-v7a", "arm64-v8a"]
//    //["armeabi", "armeabi-v7a", "arm64-v8a", "x86", "x86_64","armeabi-v7a", "arm64-v8a", "x86", "x86_64"]
//    arguments = "-DANDROID_STL=c++_static"
//    cppFlags = "-std=c++11"
}

//task clean(type: Delete) {
//    delete rootProject.buildDir
//}

tasks.register<Delete>("clean"){
    delete(rootProject.buildDir)
}